package edu.wust;

import java.math.BigInteger;

public class exam14 {
    public static long go1(long count,long num){
        long temp=num;
        while(temp!=1){
            if(temp%2==0){
                temp/=2;
            }
            else{
                temp=temp*3+1;
            }
            count++;
         }
    return count;}
    public static void main(String[] args) {
        long max=0;
        long count=1;
        long temp=0;
        for(long i=2;i<1000000;i++){
            count=1;
           count=go1(count,i);
            max=Math.max(max,count);
            if(max==count)
                temp=i;
        }
        System.out.println(max);
        System.out.println(temp);
    }
}

